<p id="notice"><%= notice %></p>

<p>
  <b>Name:</b>
  <%= @product.name %>
</p>

<p>
  <b>Picture:</b>
  <%= @product.picture %>
</p>

<p>
  <b>Price:</b>
  <%= @product.price %>
</p>

<p>
  <b>Category:</b>
  <%= @product.category.name %>
</p>

<%= @product.comments.each do |comment| %>
	<p><%= comment.content %></p>
	<p><%= time_ago_in_words comment.created_at %> ago</p>
	<p><%= link_to "Delete this comment", [@product, comment], :method => :delete, :confirm => "Are you sure delete this comment?" %></p>
<% end %>
<!--Form post comment-->
<%= form_for [@product, @product.comments.build] do |f| %>
<p><%= f.text_area :content, :size => '20x5' %></p>
<p><%= f.submit "Post Comment", disable_with: 'Posting Comment...' %></p>
<% end %>


<%= link_to 'Edit', edit_product_path(@product) %> |
<%= link_to 'Back', products_path %>
